//package com.sixbro.jpa.config;
//
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.boot.jdbc.DataSourceBuilder;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
//import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
//import org.springframework.orm.jpa.JpaTransactionManager;
//import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
//import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
//import org.springframework.transaction.PlatformTransactionManager;
//import org.springframework.transaction.annotation.EnableTransactionManagement;
//
//import javax.persistence.EntityManagerFactory;
//import javax.sql.DataSource;
//
///**
// * <p>
// * JPA配置类
// * </p>
// *
// * @author: Mr.Lu
// * @since: 2021/12/10 15:58
// */
//@Configuration
//@EnableTransactionManagement
//@EnableJpaAuditing
////@EnableJpaRepositories(basePackages = "com.sixbro.jpa.repository", transactionManagerRef = "jpaTransactionManager")
//@EnableJpaRepositories(basePackages = "com.sixbro.jpa.repository")
//public class JpaConfiguration {
//
////    @Bean
////    @ConfigurationProperties(prefix = "spring.datasource")
////    public DataSource dataSource() {
////        return DataSourceBuilder.create().build();
////    }
//
////    @Bean
////    public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
////        HibernateJpaVendorAdapter japVendor = new HibernateJpaVendorAdapter();
////        japVendor.setGenerateDdl(false);
////        LocalContainerEntityManagerFactoryBean entityManagerFactory = new LocalContainerEntityManagerFactoryBean();
////        entityManagerFactory.setDataSource(dataSource());
////        entityManagerFactory.setJpaVendorAdapter(japVendor);
////        entityManagerFactory.setPackagesToScan("com.sixbro.jpa.entity");
////        return entityManagerFactory;
////    }
////
////    @Bean
////    public PlatformTransactionManager jpaTransactionManager(EntityManagerFactory entityManagerFactory) {
////        JpaTransactionManager transactionManager = new JpaTransactionManager();
////        transactionManager.setEntityManagerFactory(entityManagerFactory);
////        return transactionManager;
////    }
//}
